Skip to main content

ExecuteCommand

Executes the command which will be used to create the document file (text document, spreadsheet, presentation, form document, PDF). See the Text document API, Spreadsheet API, Presentation API, or Form API sections for more information which commands are available for various document types.

Please note, that for the .docbuilder file the CDocBuilder.ExecuteCommand method is not used explicitly. The command itself is used instead. See the example below.

Syntax

bool ExecuteCommand(const wchar_t* sCommand, CDocBuilderValue* oRetValue = 0);

Parameters

NameData typeDefaultDescription
sCommandconst wchar_t*The command which will be used to create the document file (in C++, the escape character must be used when the command contains quotation symbols).
oRetValueCDocBuilderValue*0The command return value.

Example

C++

std::wstring sWorkDirectory = NSUtils::GetBuilderDirectory();
CDocBuilder::Initialize(sWorkDirectory.c_str());
CDocBuilder oBuilder;
oBuilder.ExecuteCommand(L"oParagraph.AddText(\"Hello, world!\");");
CDocBuilder::Dispose();

.docbuilder

oParagraph.AddText("Hello, world!")